-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: don't use default dbt selection with asset checks #18117
bugfix: don't use default dbt selection with asset checks #18117
Conversation
Current dependencies on/for this PR: This stack of pull requests is managed by Graphite. |
aa23fff
to
bcb5f98
Compare
python_modules/libraries/dagster-dbt/dagster_dbt/core/resources_v2.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some wording suggestions on the logging statements
python_modules/libraries/dagster-dbt/dagster_dbt/core/resources_v2.py
Outdated
Show resolved
Hide resolved
python_modules/libraries/dagster-dbt/dagster_dbt/core/resources_v2.py
Outdated
Show resolved
Hide resolved
) | ||
else: | ||
logger.info( | ||
"A dbt subsetted execution is not being performed. Expanding the default dbt selection" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Expanding" is ambiguous here. We need to explain that
- We are taking the default selection and just explicitly selecting the models and tests from it
- (1) is expected to be equivalent to the default selection, although it is more verbose
bcb5f98
to
465529f
Compare
465529f
to
315727f
Compare
python_modules/libraries/dagster-dbt/dagster_dbt/core/resources_v2.py
Outdated
Show resolved
Hide resolved
…s_v2.py Co-authored-by: Rex Ledesma <[email protected]>
Bug report: https://dagster.slack.com/archives/C04CW71AGBW/p1700237771181059?thread_ts=1697638899.590569&cid=C04CW71AGBW
Synopsis:
DBT_INDIRECT_SELECTION=eager
[side note, I'm kind of surprised this isn't configurable].DBT_INDIRECT_SELECTION=empty
so that we have the option to exclude checks if they're not in the selectionSolutions:
DBT_INDIRECT_SELECTION=empty
when we're doing a subset and passing the explicit selection, otherwise use eager and the default selection.A concern for (2) is relationship tests. Take the case of two models
customers,
one non null testorders
, one relationship test with customersDbt will resolve selection
customers
to thecustomers
model and both the null test and the relationship test. If you're not using asset checks this is fine, we'll emit observations for both tests. If you are using checks, currently@dbt_assets(...select="customers")
will only define the null test. This makes sense- we wouldn't even display the relationship test if we ingested it, because we didn't ingest the model its on.With #1, we won't execute the relationship test (which matches the current behavior). With #2 we will whenever we switch over to eager, which is unexpected because we didn't model it.
Side note: we should document that when you enable checks, relationship tests on non selected models will no longer run